package com.bulletelc.apollopre.module.main.cart;

import com.bulletelc.apollopre.entity.CartListBean;
import com.bulletelc.apollopre.entity.OrderConfirmBean;
import com.bulletelc.apollopre.entity.WxShareBean;
import com.bulletelc.apollopre.framework.IPresenter;
import com.bulletelc.apollopre.framework.IView;

import java.util.List;

/**
 * author: lhl
 * date  : 2018/01/19
 * desc  : TODO
 */

public interface CartContract {

    interface View extends IView {
        void onSuccessCartList(List<CartListBean> cartListBeans);
        void onFailCartList(String fail);
        void onErrorCartList(String error);

        void onSuccessCountChange(boolean isAdd,int groupPosition,int childPosition,boolean isChecked);
        void onFailCountChange(String fail);
        void onErrorCountChange(String error);

        void onSuccessDeleteCart();
        void onFailDeleteCart(String fail);
        void onErrorDeleteCart(String error);

        void onSuccessClearing(OrderConfirmBean confirmBean);
        void onFailClearing(String fail);
        void onErrorClearing(String error);

        void onSuccessCreateCartShare(WxShareBean wxShareBean);
        void onFailCreateCartShare(String fail);
        void onErrorCreateCartShare(String error);

        void onSuccessShareCart(boolean b);
        void onFailShareCart(String fail);
        void onErrorShareCart(String error);
    }

    interface Presenter extends IPresenter<View> {
        void getCartList(String token);

        void addCount(String json,String token,int groupPosition,int childPosition,boolean isChecked);

        void reduceCount(String json,String token,int groupPosition,int childPosition,boolean isChecked);

        void deleteCart(String json,String token);

        void clearing(String json, String token);

        void createCartShare(String cid);

        void shareCallback(String cid);
    }


}
